﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler.Menu
{
    public class GetMenuTreeCommandHandler : IRequestHandler<GetMenuTreeCommand, List<mentumns>>
    {
        protected readonly IMenuSerivice menuSerivice;

        public GetMenuTreeCommandHandler(IMenuSerivice menuSerivice)
        {
            this.menuSerivice = menuSerivice;
        }

        public async Task<List<mentumns>> Handle(GetMenuTreeCommand request, CancellationToken cancellationToken)
        {
            return await menuSerivice.GetMenuTree();
        }
    }
}
